package edu.kjxy.demo0326;

public class demo02 {

	public static void main(String[] args) {
		int[] a = {1, 2, 3, 4};
		int sum = 0;
		
		//把数组中的每一个数读取下来，记录到sum中
		for (int n : a) {
			sum += n;
		}
		
		System.out.println(sum);
	}

}
